import cv2
from utils.plot_utils import get_color_table, plot_one_box

'''
 #0, bbox(  60,  106,  152,  214) confidence: 0.872998 classId is 0 
 #1, bbox( 379,   35,  462,  133) confidence: 0.717804 classId is 0 
 #2, bbox( 247,   58,  350,  181) confidence: 0.680454 classId is 1
 
  #0, bbox(  72,  118,  140,  202) confidence: 0.672762 classId is 1 
 #1, bbox( 253,   73,  334,  175) confidence: 0.787931 classId is 2 

  #0, bbox(  72,  118,  140,  202) confidence: 0.672762 classId is 1 
 #1, bbox( 361,   58,  429,  140) confidence: 0.380299 classId is 1 
 #2, bbox( 537,    0,  628,  100) confidence: 0.350421 classId is 1 
 #3, bbox( 253,   73,  334,  175) confidence: 0.787931 classId is 2

  #0, bbox(  56,   35,  134,  138) confidence: 0.811078 classId is 0 
 #1, bbox( 160,   78,  201,  133) confidence: 0.766643 classId is 0

'''
dict_label = {0:'mask', 1:'person', 2:'hat'}
bbox = [[56,   35,  134,  138, 0], [160,   78,  201,  133, 0]] #, [537,    0,  628,  100, 1],[253,   73,  334,  175, 2]]
img_path = './data/demo_data/facemask.jpg'
img = cv2.imread(img_path)

for box in bbox:
    cv2.rectangle(img, (box[0], box[1]), (box[2], box[3]), (0, 0, 255), 2)
    label = dict_label[box[4]]
    cv2.putText(img, label, (box[0], box[1] - 2), 0, float(2) / 3, [0, 0, 0], thickness=1, lineType=cv2.LINE_AA)

cv2.imshow('Atlas500', img)
cv2.waitKey()